//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension SSMContacts {
    // MARK: Enums

    public enum AcceptCodeValidation: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case enforce = "ENFORCE"
        case ignore = "IGNORE"
        public var description: String { return self.rawValue }
    }

    public enum AcceptType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case delivered = "DELIVERED"
        case read = "READ"
        public var description: String { return self.rawValue }
    }

    public enum ActivationStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case activated = "ACTIVATED"
        case notActivated = "NOT_ACTIVATED"
        public var description: String { return self.rawValue }
    }

    public enum ChannelType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case email = "EMAIL"
        case sms = "SMS"
        case voice = "VOICE"
        public var description: String { return self.rawValue }
    }

    public enum ContactType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case escalation = "ESCALATION"
        case oncallSchedule = "ONCALL_SCHEDULE"
        case personal = "PERSONAL"
        public var description: String { return self.rawValue }
    }

    public enum DayOfWeek: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case fri = "FRI"
        case mon = "MON"
        case sat = "SAT"
        case sun = "SUN"
        case thu = "THU"
        case tue = "TUE"
        case wed = "WED"
        public var description: String { return self.rawValue }
    }

    public enum ReceiptType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case delivered = "DELIVERED"
        case error = "ERROR"
        case read = "READ"
        case sent = "SENT"
        case stop = "STOP"
        public var description: String { return self.rawValue }
    }

    public enum ShiftType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case overridden = "OVERRIDDEN"
        case regular = "REGULAR"
        public var description: String { return self.rawValue }
    }

    public enum ValidationExceptionReason: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case cannotParse = "CANNOT_PARSE"
        case fieldValidationFailed = "FIELD_VALIDATION_FAILED"
        case other = "OTHER"
        case unknownOperation = "UNKNOWN_OPERATION"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AcceptPageRequest: AWSEncodableShape {
        /// A 6-digit code used to acknowledge the page.
        public let acceptCode: String
        /// An optional field that Incident Manager uses to ENFORCE AcceptCode validation when acknowledging an page. Acknowledgement can occur by replying to a page, or when entering the AcceptCode in the console. Enforcing AcceptCode validation causes Incident Manager to verify that the code entered by the user matches the code sent by Incident Manager with the page. Incident Manager can also IGNORE AcceptCode validation. Ignoring AcceptCode validation causes Incident Manager to accept any value entered for the AcceptCode.
        public let acceptCodeValidation: AcceptCodeValidation?
        /// The type indicates if the page was DELIVERED or READ.
        public let acceptType: AcceptType
        /// The ARN of the contact channel.
        public let contactChannelId: String?
        /// Information provided by the user when the user acknowledges the page.
        public let note: String?
        /// The Amazon Resource Name (ARN) of the engagement to a contact channel.
        public let pageId: String

        @inlinable
        public init(acceptCode: String, acceptCodeValidation: AcceptCodeValidation? = nil, acceptType: AcceptType, contactChannelId: String? = nil, note: String? = nil, pageId: String) {
            self.acceptCode = acceptCode
            self.acceptCodeValidation = acceptCodeValidation
            self.acceptType = acceptType
            self.contactChannelId = contactChannelId
            self.note = note
            self.pageId = pageId
        }

        public func validate(name: String) throws {
            try self.validate(self.acceptCode, name: "acceptCode", parent: name, max: 10)
            try self.validate(self.acceptCode, name: "acceptCode", parent: name, min: 6)
            try self.validate(self.acceptCode, name: "acceptCode", parent: name, pattern: "^[0-9]*$")
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, max: 2048)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, min: 1)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.note, name: "note", parent: name, max: 2048)
            try self.validate(self.note, name: "note", parent: name, min: 1)
            try self.validate(self.note, name: "note", parent: name, pattern: "^[.\\s\\S]*$")
            try self.validate(self.pageId, name: "pageId", parent: name, max: 2048)
            try self.validate(self.pageId, name: "pageId", parent: name, min: 1)
            try self.validate(self.pageId, name: "pageId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case acceptCode = "AcceptCode"
            case acceptCodeValidation = "AcceptCodeValidation"
            case acceptType = "AcceptType"
            case contactChannelId = "ContactChannelId"
            case note = "Note"
            case pageId = "PageId"
        }
    }

    public struct AcceptPageResult: AWSDecodableShape {
        public init() {}
    }

    public struct ActivateContactChannelRequest: AWSEncodableShape {
        /// The code sent to the contact channel when it was created in the contact.
        public let activationCode: String
        /// The Amazon Resource Name (ARN) of the contact channel.
        public let contactChannelId: String

        @inlinable
        public init(activationCode: String, contactChannelId: String) {
            self.activationCode = activationCode
            self.contactChannelId = contactChannelId
        }

        public func validate(name: String) throws {
            try self.validate(self.activationCode, name: "activationCode", parent: name, max: 10)
            try self.validate(self.activationCode, name: "activationCode", parent: name, min: 6)
            try self.validate(self.activationCode, name: "activationCode", parent: name, pattern: "^[0-9]*$")
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, max: 2048)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, min: 1)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case activationCode = "ActivationCode"
            case contactChannelId = "ContactChannelId"
        }
    }

    public struct ActivateContactChannelResult: AWSDecodableShape {
        public init() {}
    }

    public struct ChannelTargetInfo: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the contact channel.
        public let contactChannelId: String
        /// The number of minutes to wait before retrying to send engagement if the engagement initially failed.
        public let retryIntervalInMinutes: Int?

        @inlinable
        public init(contactChannelId: String, retryIntervalInMinutes: Int? = nil) {
            self.contactChannelId = contactChannelId
            self.retryIntervalInMinutes = retryIntervalInMinutes
        }

        public func validate(name: String) throws {
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, max: 2048)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, min: 1)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.retryIntervalInMinutes, name: "retryIntervalInMinutes", parent: name, max: 60)
            try self.validate(self.retryIntervalInMinutes, name: "retryIntervalInMinutes", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannelId = "ContactChannelId"
            case retryIntervalInMinutes = "RetryIntervalInMinutes"
        }
    }

    public struct ConflictException: AWSErrorShape {
        /// List of dependent entities containing information on relation type and resourceArns linked to the resource in use
        public let dependentEntities: [DependentEntity]?
        public let message: String
        /// Identifier of the resource in use
        public let resourceId: String
        /// Type of the resource in use
        public let resourceType: String

        @inlinable
        public init(dependentEntities: [DependentEntity]? = nil, message: String, resourceId: String, resourceType: String) {
            self.dependentEntities = dependentEntities
            self.message = message
            self.resourceId = resourceId
            self.resourceType = resourceType
        }

        private enum CodingKeys: String, CodingKey {
            case dependentEntities = "DependentEntities"
            case message = "Message"
            case resourceId = "ResourceId"
            case resourceType = "ResourceType"
        }
    }

    public struct Contact: AWSDecodableShape {
        /// The unique and identifiable alias of the contact or escalation plan.
        public let alias: String
        /// The Amazon Resource Name (ARN) of the contact or escalation plan.
        public let contactArn: String
        /// The full name of the contact or escalation plan.
        public let displayName: String?
        /// The type of contact.    PERSONAL: A single, individual contact.    ESCALATION: An escalation plan.    ONCALL_SCHEDULE: An on-call schedule.
        public let type: ContactType

        @inlinable
        public init(alias: String, contactArn: String, displayName: String? = nil, type: ContactType) {
            self.alias = alias
            self.contactArn = contactArn
            self.displayName = displayName
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case contactArn = "ContactArn"
            case displayName = "DisplayName"
            case type = "Type"
        }
    }

    public struct ContactChannel: AWSDecodableShape {
        /// A Boolean value describing if the contact channel has been activated or not. If the contact channel isn't activated, Incident Manager can't engage the contact through it.
        public let activationStatus: ActivationStatus
        /// The ARN of the contact that contains the contact channel.
        public let contactArn: String
        /// The Amazon Resource Name (ARN) of the contact channel.
        public let contactChannelArn: String
        /// The details that Incident Manager uses when trying to engage the contact channel.
        public let deliveryAddress: ContactChannelAddress
        /// The name of the contact channel.
        public let name: String
        /// The type of the contact channel. Incident Manager supports three contact methods:   SMS   VOICE   EMAIL
        public let type: ChannelType?

        @inlinable
        public init(activationStatus: ActivationStatus, contactArn: String, contactChannelArn: String, deliveryAddress: ContactChannelAddress, name: String, type: ChannelType? = nil) {
            self.activationStatus = activationStatus
            self.contactArn = contactArn
            self.contactChannelArn = contactChannelArn
            self.deliveryAddress = deliveryAddress
            self.name = name
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case activationStatus = "ActivationStatus"
            case contactArn = "ContactArn"
            case contactChannelArn = "ContactChannelArn"
            case deliveryAddress = "DeliveryAddress"
            case name = "Name"
            case type = "Type"
        }
    }

    public struct ContactChannelAddress: AWSEncodableShape & AWSDecodableShape {
        /// The format is dependent on the type of the contact channel. The following are the expected formats:   SMS - '+' followed by the country code and phone number   VOICE - '+' followed by the country code and phone number   EMAIL - any standard email format
        public let simpleAddress: String?

        @inlinable
        public init(simpleAddress: String? = nil) {
            self.simpleAddress = simpleAddress
        }

        public func validate(name: String) throws {
            try self.validate(self.simpleAddress, name: "simpleAddress", parent: name, max: 320)
            try self.validate(self.simpleAddress, name: "simpleAddress", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case simpleAddress = "SimpleAddress"
        }
    }

    public struct ContactTargetInfo: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the contact.
        public let contactId: String?
        /// A Boolean value determining if the contact's acknowledgement stops the progress of stages in the plan.
        public let isEssential: Bool

        @inlinable
        public init(contactId: String? = nil, isEssential: Bool) {
            self.contactId = contactId
            self.isEssential = isEssential
        }

        public func validate(name: String) throws {
            try self.validate(self.contactId, name: "contactId", parent: name, max: 2048)
            try self.validate(self.contactId, name: "contactId", parent: name, min: 1)
            try self.validate(self.contactId, name: "contactId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactId = "ContactId"
            case isEssential = "IsEssential"
        }
    }

    public struct CoverageTime: AWSEncodableShape & AWSDecodableShape {
        /// Information about when the on-call rotation shift ends.
        public let end: HandOffTime?
        /// Information about when the on-call rotation shift begins.
        public let start: HandOffTime?

        @inlinable
        public init(end: HandOffTime? = nil, start: HandOffTime? = nil) {
            self.end = end
            self.start = start
        }

        public func validate(name: String) throws {
            try self.end?.validate(name: "\(name).end")
            try self.start?.validate(name: "\(name).start")
        }

        private enum CodingKeys: String, CodingKey {
            case end = "End"
            case start = "Start"
        }
    }

    public struct CreateContactChannelRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact you are adding the contact channel to.
        public let contactId: String
        /// If you want to activate the channel at a later time, you can choose to defer activation. Incident Manager can't engage your contact channel until it has been activated.
        public let deferActivation: Bool?
        /// The details that Incident Manager uses when trying to engage the contact channel. The format is dependent on the type of the contact channel. The following are the expected formats:   SMS - '+' followed by the country code and phone number   VOICE - '+' followed by the country code and phone number   EMAIL - any standard email format
        public let deliveryAddress: ContactChannelAddress
        /// A token ensuring that the operation is called only once with the specified details.
        public let idempotencyToken: String?
        /// The name of the contact channel.
        public let name: String
        /// Incident Manager supports three types of contact channels:    SMS     VOICE     EMAIL
        public let type: ChannelType

        @inlinable
        public init(contactId: String, deferActivation: Bool? = nil, deliveryAddress: ContactChannelAddress, idempotencyToken: String? = CreateContactChannelRequest.idempotencyToken(), name: String, type: ChannelType) {
            self.contactId = contactId
            self.deferActivation = deferActivation
            self.deliveryAddress = deliveryAddress
            self.idempotencyToken = idempotencyToken
            self.name = name
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.contactId, name: "contactId", parent: name, max: 2048)
            try self.validate(self.contactId, name: "contactId", parent: name, min: 1)
            try self.validate(self.contactId, name: "contactId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.deliveryAddress.validate(name: "\(name).deliveryAddress")
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, max: 2048)
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.\\-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactId = "ContactId"
            case deferActivation = "DeferActivation"
            case deliveryAddress = "DeliveryAddress"
            case idempotencyToken = "IdempotencyToken"
            case name = "Name"
            case type = "Type"
        }
    }

    public struct CreateContactChannelResult: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the contact channel.
        public let contactChannelArn: String

        @inlinable
        public init(contactChannelArn: String) {
            self.contactChannelArn = contactChannelArn
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannelArn = "ContactChannelArn"
        }
    }

    public struct CreateContactRequest: AWSEncodableShape {
        /// The short name to quickly identify a contact or escalation plan. The contact alias must be unique and identifiable.
        public let alias: String
        /// The full name of the contact or escalation plan.
        public let displayName: String?
        /// A token ensuring that the operation is called only once with the specified details.
        public let idempotencyToken: String?
        /// A list of stages. A contact has an engagement plan with stages that contact specified contact channels. An escalation plan uses stages that contact specified contacts.
        public let plan: Plan
        /// Adds a tag to the target. You can only tag resources created in the first Region of your replication set.
        public let tags: [Tag]?
        /// The type of contact to create.    PERSONAL: A single, individual contact.    ESCALATION: An escalation plan.    ONCALL_SCHEDULE: An on-call schedule.
        public let type: ContactType

        @inlinable
        public init(alias: String, displayName: String? = nil, idempotencyToken: String? = CreateContactRequest.idempotencyToken(), plan: Plan, tags: [Tag]? = nil, type: ContactType) {
            self.alias = alias
            self.displayName = displayName
            self.idempotencyToken = idempotencyToken
            self.plan = plan
            self.tags = tags
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.alias, name: "alias", parent: name, max: 255)
            try self.validate(self.alias, name: "alias", parent: name, min: 1)
            try self.validate(self.alias, name: "alias", parent: name, pattern: "^[a-z0-9_\\-]*$")
            try self.validate(self.displayName, name: "displayName", parent: name, max: 255)
            try self.validate(self.displayName, name: "displayName", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.\\-]*$")
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, max: 2048)
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.plan.validate(name: "\(name).plan")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case displayName = "DisplayName"
            case idempotencyToken = "IdempotencyToken"
            case plan = "Plan"
            case tags = "Tags"
            case type = "Type"
        }
    }

    public struct CreateContactResult: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the created contact or escalation plan.
        public let contactArn: String

        @inlinable
        public init(contactArn: String) {
            self.contactArn = contactArn
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
        }
    }

    public struct CreateRotationOverrideRequest: AWSEncodableShape {
        /// The date and time when the override ends.
        public let endTime: Date
        /// A token that ensures that the operation is called only once with the specified details.
        public let idempotencyToken: String?
        /// The Amazon Resource Names (ARNs) of the contacts to replace those in the current on-call rotation with. If you want to include any current team members in the override shift, you must include their ARNs in the new contact ID list.
        public let newContactIds: [String]
        /// The Amazon Resource Name (ARN) of the rotation to create an override for.
        public let rotationId: String
        /// The date and time when the override goes into effect.
        public let startTime: Date

        @inlinable
        public init(endTime: Date, idempotencyToken: String? = nil, newContactIds: [String], rotationId: String, startTime: Date) {
            self.endTime = endTime
            self.idempotencyToken = idempotencyToken
            self.newContactIds = newContactIds
            self.rotationId = rotationId
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, max: 2048)
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.newContactIds.forEach {
                try validate($0, name: "newContactIds[]", parent: name, max: 2048)
                try validate($0, name: "newContactIds[]", parent: name, min: 1)
                try validate($0, name: "newContactIds[]", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            }
            try self.validate(self.newContactIds, name: "newContactIds", parent: name, max: 30)
            try self.validate(self.rotationId, name: "rotationId", parent: name, max: 2048)
            try self.validate(self.rotationId, name: "rotationId", parent: name, min: 1)
            try self.validate(self.rotationId, name: "rotationId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case idempotencyToken = "IdempotencyToken"
            case newContactIds = "NewContactIds"
            case rotationId = "RotationId"
            case startTime = "StartTime"
        }
    }

    public struct CreateRotationOverrideResult: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the created rotation override.
        public let rotationOverrideId: String

        @inlinable
        public init(rotationOverrideId: String) {
            self.rotationOverrideId = rotationOverrideId
        }

        private enum CodingKeys: String, CodingKey {
            case rotationOverrideId = "RotationOverrideId"
        }
    }

    public struct CreateRotationRequest: AWSEncodableShape {
        /// The Amazon Resource Names (ARNs) of the contacts to add to the rotation.  Only the PERSONAL contact type is supported. The contact types ESCALATION and ONCALL_SCHEDULE are not supported for this operation.   The order that you list the contacts in is their shift order in the rotation schedule. To change the order of the contact's shifts, use the UpdateRotation operation.
        public let contactIds: [String]
        /// A token that ensures that the operation is called only once with the specified details.
        public let idempotencyToken: String?
        /// The name of the rotation.
        public let name: String
        /// Information about the rule that specifies when a shift's team members rotate.
        public let recurrence: RecurrenceSettings
        /// The date and time that the rotation goes into effect.
        public let startTime: Date?
        /// Optional metadata to assign to the rotation. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For more information, see Tagging Incident Manager resources in the Incident Manager User Guide.
        public let tags: [Tag]?
        /// The time zone to base the rotation’s activity on in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.  Designators for time zones that don’t support Daylight Savings Time rules, such as Pacific Standard Time (PST), are not supported.
        public let timeZoneId: String

        @inlinable
        public init(contactIds: [String], idempotencyToken: String? = nil, name: String, recurrence: RecurrenceSettings, startTime: Date? = nil, tags: [Tag]? = nil, timeZoneId: String) {
            self.contactIds = contactIds
            self.idempotencyToken = idempotencyToken
            self.name = name
            self.recurrence = recurrence
            self.startTime = startTime
            self.tags = tags
            self.timeZoneId = timeZoneId
        }

        public func validate(name: String) throws {
            try self.contactIds.forEach {
                try validate($0, name: "contactIds[]", parent: name, max: 2048)
                try validate($0, name: "contactIds[]", parent: name, min: 1)
                try validate($0, name: "contactIds[]", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            }
            try self.validate(self.contactIds, name: "contactIds", parent: name, max: 30)
            try self.validate(self.contactIds, name: "contactIds", parent: name, min: 1)
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, max: 2048)
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[a-zA-Z0-9_\\-\\s\\.]*$")
            try self.recurrence.validate(name: "\(name).recurrence")
            try self.tags?.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, max: 255)
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, min: 1)
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, pattern: "^[:a-zA-Z0-9_\\-\\s\\.\\\\/]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactIds = "ContactIds"
            case idempotencyToken = "IdempotencyToken"
            case name = "Name"
            case recurrence = "Recurrence"
            case startTime = "StartTime"
            case tags = "Tags"
            case timeZoneId = "TimeZoneId"
        }
    }

    public struct CreateRotationResult: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the created rotation.
        public let rotationArn: String

        @inlinable
        public init(rotationArn: String) {
            self.rotationArn = rotationArn
        }

        private enum CodingKeys: String, CodingKey {
            case rotationArn = "RotationArn"
        }
    }

    public struct DeactivateContactChannelRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact channel you're deactivating.
        public let contactChannelId: String

        @inlinable
        public init(contactChannelId: String) {
            self.contactChannelId = contactChannelId
        }

        public func validate(name: String) throws {
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, max: 2048)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, min: 1)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannelId = "ContactChannelId"
        }
    }

    public struct DeactivateContactChannelResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteContactChannelRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact channel.
        public let contactChannelId: String

        @inlinable
        public init(contactChannelId: String) {
            self.contactChannelId = contactChannelId
        }

        public func validate(name: String) throws {
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, max: 2048)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, min: 1)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannelId = "ContactChannelId"
        }
    }

    public struct DeleteContactChannelResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteContactRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact that you're deleting.
        public let contactId: String

        @inlinable
        public init(contactId: String) {
            self.contactId = contactId
        }

        public func validate(name: String) throws {
            try self.validate(self.contactId, name: "contactId", parent: name, max: 2048)
            try self.validate(self.contactId, name: "contactId", parent: name, min: 1)
            try self.validate(self.contactId, name: "contactId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactId = "ContactId"
        }
    }

    public struct DeleteContactResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteRotationOverrideRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the rotation that was overridden.
        public let rotationId: String
        /// The Amazon Resource Name (ARN) of the on-call rotation override to delete.
        public let rotationOverrideId: String

        @inlinable
        public init(rotationId: String, rotationOverrideId: String) {
            self.rotationId = rotationId
            self.rotationOverrideId = rotationOverrideId
        }

        public func validate(name: String) throws {
            try self.validate(self.rotationId, name: "rotationId", parent: name, max: 2048)
            try self.validate(self.rotationId, name: "rotationId", parent: name, min: 1)
            try self.validate(self.rotationId, name: "rotationId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.rotationOverrideId, name: "rotationOverrideId", parent: name, max: 39)
            try self.validate(self.rotationOverrideId, name: "rotationOverrideId", parent: name, min: 36)
            try self.validate(self.rotationOverrideId, name: "rotationOverrideId", parent: name, pattern: "^([a-fA-Z0-9]{8,11}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}$")
        }

        private enum CodingKeys: String, CodingKey {
            case rotationId = "RotationId"
            case rotationOverrideId = "RotationOverrideId"
        }
    }

    public struct DeleteRotationOverrideResult: AWSDecodableShape {
        public init() {}
    }

    public struct DeleteRotationRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the on-call rotation to delete.
        public let rotationId: String

        @inlinable
        public init(rotationId: String) {
            self.rotationId = rotationId
        }

        public func validate(name: String) throws {
            try self.validate(self.rotationId, name: "rotationId", parent: name, max: 2048)
            try self.validate(self.rotationId, name: "rotationId", parent: name, min: 1)
            try self.validate(self.rotationId, name: "rotationId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case rotationId = "RotationId"
        }
    }

    public struct DeleteRotationResult: AWSDecodableShape {
        public init() {}
    }

    public struct DependentEntity: AWSDecodableShape {
        /// The Amazon Resource Names (ARNs) of the dependent resources.
        public let dependentResourceIds: [String]
        /// The type of relationship between one resource and the other resource that it is related to or depends on.
        public let relationType: String

        @inlinable
        public init(dependentResourceIds: [String], relationType: String) {
            self.dependentResourceIds = dependentResourceIds
            self.relationType = relationType
        }

        private enum CodingKeys: String, CodingKey {
            case dependentResourceIds = "DependentResourceIds"
            case relationType = "RelationType"
        }
    }

    public struct DescribeEngagementRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the engagement you want the details of.
        public let engagementId: String

        @inlinable
        public init(engagementId: String) {
            self.engagementId = engagementId
        }

        public func validate(name: String) throws {
            try self.validate(self.engagementId, name: "engagementId", parent: name, max: 2048)
            try self.validate(self.engagementId, name: "engagementId", parent: name, min: 1)
            try self.validate(self.engagementId, name: "engagementId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case engagementId = "EngagementId"
        }
    }

    public struct DescribeEngagementResult: AWSDecodableShape {
        /// The ARN of the escalation plan or contacts involved in the engagement.
        public let contactArn: String
        /// The secure content of the message that was sent to the contact. Use this field for engagements to VOICE and EMAIL.
        public let content: String
        /// The ARN of the engagement.
        public let engagementArn: String
        /// The ARN of the incident in which the engagement occurred.
        public let incidentId: String?
        /// The insecure content of the message that was sent to the contact. Use this field for engagements to SMS.
        public let publicContent: String?
        /// The insecure subject of the message that was sent to the contact. Use this field for engagements to SMS.
        public let publicSubject: String?
        /// The user that started the engagement.
        public let sender: String
        /// The time that the engagement started.
        public let startTime: Date?
        /// The time that the engagement ended.
        public let stopTime: Date?
        /// The secure subject of the message that was sent to the contact. Use this field for engagements to VOICE and EMAIL.
        public let subject: String

        @inlinable
        public init(contactArn: String, content: String, engagementArn: String, incidentId: String? = nil, publicContent: String? = nil, publicSubject: String? = nil, sender: String, startTime: Date? = nil, stopTime: Date? = nil, subject: String) {
            self.contactArn = contactArn
            self.content = content
            self.engagementArn = engagementArn
            self.incidentId = incidentId
            self.publicContent = publicContent
            self.publicSubject = publicSubject
            self.sender = sender
            self.startTime = startTime
            self.stopTime = stopTime
            self.subject = subject
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
            case content = "Content"
            case engagementArn = "EngagementArn"
            case incidentId = "IncidentId"
            case publicContent = "PublicContent"
            case publicSubject = "PublicSubject"
            case sender = "Sender"
            case startTime = "StartTime"
            case stopTime = "StopTime"
            case subject = "Subject"
        }
    }

    public struct DescribePageRequest: AWSEncodableShape {
        /// The ID of the engagement to a contact channel.
        public let pageId: String

        @inlinable
        public init(pageId: String) {
            self.pageId = pageId
        }

        public func validate(name: String) throws {
            try self.validate(self.pageId, name: "pageId", parent: name, max: 2048)
            try self.validate(self.pageId, name: "pageId", parent: name, min: 1)
            try self.validate(self.pageId, name: "pageId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case pageId = "PageId"
        }
    }

    public struct DescribePageResult: AWSDecodableShape {
        /// The ARN of the contact that was engaged.
        public let contactArn: String
        /// The secure content of the message that was sent to the contact. Use this field for engagements to VOICE and EMAIL.
        public let content: String
        /// The time that the contact channel received the engagement.
        public let deliveryTime: Date?
        /// The ARN of the engagement that engaged the contact channel.
        public let engagementArn: String
        /// The ARN of the incident that engaged the contact channel.
        public let incidentId: String?
        /// The Amazon Resource Name (ARN) of the engagement to a contact channel.
        public let pageArn: String
        /// The insecure content of the message that was sent to the contact. Use this field for engagements to SMS.
        public let publicContent: String?
        /// The insecure subject of the message that was sent to the contact. Use this field for engagements to SMS.
        public let publicSubject: String?
        /// The time that the contact channel acknowledged the engagement.
        public let readTime: Date?
        /// The user that started the engagement.
        public let sender: String
        /// The time the engagement was sent to the contact channel.
        public let sentTime: Date?
        /// The secure subject of the message that was sent to the contact. Use this field for engagements to VOICE and EMAIL.
        public let subject: String

        @inlinable
        public init(contactArn: String, content: String, deliveryTime: Date? = nil, engagementArn: String, incidentId: String? = nil, pageArn: String, publicContent: String? = nil, publicSubject: String? = nil, readTime: Date? = nil, sender: String, sentTime: Date? = nil, subject: String) {
            self.contactArn = contactArn
            self.content = content
            self.deliveryTime = deliveryTime
            self.engagementArn = engagementArn
            self.incidentId = incidentId
            self.pageArn = pageArn
            self.publicContent = publicContent
            self.publicSubject = publicSubject
            self.readTime = readTime
            self.sender = sender
            self.sentTime = sentTime
            self.subject = subject
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
            case content = "Content"
            case deliveryTime = "DeliveryTime"
            case engagementArn = "EngagementArn"
            case incidentId = "IncidentId"
            case pageArn = "PageArn"
            case publicContent = "PublicContent"
            case publicSubject = "PublicSubject"
            case readTime = "ReadTime"
            case sender = "Sender"
            case sentTime = "SentTime"
            case subject = "Subject"
        }
    }

    public struct Engagement: AWSDecodableShape {
        /// The ARN of the escalation plan or contact that Incident Manager is engaging.
        public let contactArn: String
        /// The Amazon Resource Name (ARN) of the engagement.
        public let engagementArn: String
        /// The ARN of the incident that's engaging the contact.
        public let incidentId: String?
        /// The user that started the engagement.
        public let sender: String
        /// The time that the engagement began.
        public let startTime: Date?
        /// The time that the engagement ended.
        public let stopTime: Date?

        @inlinable
        public init(contactArn: String, engagementArn: String, incidentId: String? = nil, sender: String, startTime: Date? = nil, stopTime: Date? = nil) {
            self.contactArn = contactArn
            self.engagementArn = engagementArn
            self.incidentId = incidentId
            self.sender = sender
            self.startTime = startTime
            self.stopTime = stopTime
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
            case engagementArn = "EngagementArn"
            case incidentId = "IncidentId"
            case sender = "Sender"
            case startTime = "StartTime"
            case stopTime = "StopTime"
        }
    }

    public struct GetContactChannelRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact channel you want information about.
        public let contactChannelId: String

        @inlinable
        public init(contactChannelId: String) {
            self.contactChannelId = contactChannelId
        }

        public func validate(name: String) throws {
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, max: 2048)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, min: 1)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannelId = "ContactChannelId"
        }
    }

    public struct GetContactChannelResult: AWSDecodableShape {
        /// A Boolean value indicating if the contact channel has been activated or not.
        public let activationStatus: ActivationStatus?
        /// The ARN of the contact that the channel belongs to.
        public let contactArn: String
        /// The ARN of the contact channel.
        public let contactChannelArn: String
        /// The details that Incident Manager uses when trying to engage the contact channel.
        public let deliveryAddress: ContactChannelAddress
        /// The name of the contact channel
        public let name: String
        /// The type of contact channel. The type is SMS, VOICE, or EMAIL.
        public let type: ChannelType

        @inlinable
        public init(activationStatus: ActivationStatus? = nil, contactArn: String, contactChannelArn: String, deliveryAddress: ContactChannelAddress, name: String, type: ChannelType) {
            self.activationStatus = activationStatus
            self.contactArn = contactArn
            self.contactChannelArn = contactChannelArn
            self.deliveryAddress = deliveryAddress
            self.name = name
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case activationStatus = "ActivationStatus"
            case contactArn = "ContactArn"
            case contactChannelArn = "ContactChannelArn"
            case deliveryAddress = "DeliveryAddress"
            case name = "Name"
            case type = "Type"
        }
    }

    public struct GetContactPolicyRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact or escalation plan.
        public let contactArn: String

        @inlinable
        public init(contactArn: String) {
            self.contactArn = contactArn
        }

        public func validate(name: String) throws {
            try self.validate(self.contactArn, name: "contactArn", parent: name, max: 2048)
            try self.validate(self.contactArn, name: "contactArn", parent: name, min: 1)
            try self.validate(self.contactArn, name: "contactArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
        }
    }

    public struct GetContactPolicyResult: AWSDecodableShape {
        /// The ARN of the contact or escalation plan.
        public let contactArn: String?
        /// Details about the resource policy attached to the contact or escalation plan.
        public let policy: String?

        @inlinable
        public init(contactArn: String? = nil, policy: String? = nil) {
            self.contactArn = contactArn
            self.policy = policy
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
            case policy = "Policy"
        }
    }

    public struct GetContactRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact or escalation plan.
        public let contactId: String

        @inlinable
        public init(contactId: String) {
            self.contactId = contactId
        }

        public func validate(name: String) throws {
            try self.validate(self.contactId, name: "contactId", parent: name, max: 2048)
            try self.validate(self.contactId, name: "contactId", parent: name, min: 1)
            try self.validate(self.contactId, name: "contactId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactId = "ContactId"
        }
    }

    public struct GetContactResult: AWSDecodableShape {
        /// The alias of the contact or escalation plan. The alias is unique and identifiable.
        public let alias: String
        /// The ARN of the contact or escalation plan.
        public let contactArn: String
        /// The full name of the contact or escalation plan.
        public let displayName: String?
        /// Details about the specific timing or stages and targets of the escalation plan or engagement plan.
        public let plan: Plan
        /// The type of contact.
        public let type: ContactType

        @inlinable
        public init(alias: String, contactArn: String, displayName: String? = nil, plan: Plan, type: ContactType) {
            self.alias = alias
            self.contactArn = contactArn
            self.displayName = displayName
            self.plan = plan
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case alias = "Alias"
            case contactArn = "ContactArn"
            case displayName = "DisplayName"
            case plan = "Plan"
            case type = "Type"
        }
    }

    public struct GetRotationOverrideRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the overridden rotation to retrieve information about.
        public let rotationId: String
        /// The Amazon Resource Name (ARN) of the on-call rotation override to retrieve information about.
        public let rotationOverrideId: String

        @inlinable
        public init(rotationId: String, rotationOverrideId: String) {
            self.rotationId = rotationId
            self.rotationOverrideId = rotationOverrideId
        }

        public func validate(name: String) throws {
            try self.validate(self.rotationId, name: "rotationId", parent: name, max: 2048)
            try self.validate(self.rotationId, name: "rotationId", parent: name, min: 1)
            try self.validate(self.rotationId, name: "rotationId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.rotationOverrideId, name: "rotationOverrideId", parent: name, max: 39)
            try self.validate(self.rotationOverrideId, name: "rotationOverrideId", parent: name, min: 36)
            try self.validate(self.rotationOverrideId, name: "rotationOverrideId", parent: name, pattern: "^([a-fA-Z0-9]{8,11}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}$")
        }

        private enum CodingKeys: String, CodingKey {
            case rotationId = "RotationId"
            case rotationOverrideId = "RotationOverrideId"
        }
    }

    public struct GetRotationOverrideResult: AWSDecodableShape {
        /// The date and time when the override was created.
        public let createTime: Date?
        /// The date and time when the override ends.
        public let endTime: Date?
        /// The Amazon Resource Names (ARNs) of the contacts assigned to the override of the on-call rotation.
        public let newContactIds: [String]?
        /// The Amazon Resource Name (ARN) of the on-call rotation that was overridden.
        public let rotationArn: String?
        /// The Amazon Resource Name (ARN) of the override to an on-call rotation.
        public let rotationOverrideId: String?
        /// The date and time when the override goes into effect.
        public let startTime: Date?

        @inlinable
        public init(createTime: Date? = nil, endTime: Date? = nil, newContactIds: [String]? = nil, rotationArn: String? = nil, rotationOverrideId: String? = nil, startTime: Date? = nil) {
            self.createTime = createTime
            self.endTime = endTime
            self.newContactIds = newContactIds
            self.rotationArn = rotationArn
            self.rotationOverrideId = rotationOverrideId
            self.startTime = startTime
        }

        private enum CodingKeys: String, CodingKey {
            case createTime = "CreateTime"
            case endTime = "EndTime"
            case newContactIds = "NewContactIds"
            case rotationArn = "RotationArn"
            case rotationOverrideId = "RotationOverrideId"
            case startTime = "StartTime"
        }
    }

    public struct GetRotationRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the on-call rotation to retrieve information about.
        public let rotationId: String

        @inlinable
        public init(rotationId: String) {
            self.rotationId = rotationId
        }

        public func validate(name: String) throws {
            try self.validate(self.rotationId, name: "rotationId", parent: name, max: 2048)
            try self.validate(self.rotationId, name: "rotationId", parent: name, min: 1)
            try self.validate(self.rotationId, name: "rotationId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case rotationId = "RotationId"
        }
    }

    public struct GetRotationResult: AWSDecodableShape {
        /// The Amazon Resource Names (ARNs) of the contacts assigned to the on-call rotation team.
        public let contactIds: [String]
        /// The name of the on-call rotation.
        public let name: String
        /// Specifies how long a rotation lasts before restarting at the beginning of the shift order.
        public let recurrence: RecurrenceSettings
        /// The Amazon Resource Name (ARN) of the on-call rotation.
        public let rotationArn: String
        /// The specified start time for the on-call rotation.
        public let startTime: Date
        /// The time zone that the rotation’s activity is based on, in Internet Assigned Numbers Authority (IANA) format.
        public let timeZoneId: String

        @inlinable
        public init(contactIds: [String], name: String, recurrence: RecurrenceSettings, rotationArn: String, startTime: Date, timeZoneId: String) {
            self.contactIds = contactIds
            self.name = name
            self.recurrence = recurrence
            self.rotationArn = rotationArn
            self.startTime = startTime
            self.timeZoneId = timeZoneId
        }

        private enum CodingKeys: String, CodingKey {
            case contactIds = "ContactIds"
            case name = "Name"
            case recurrence = "Recurrence"
            case rotationArn = "RotationArn"
            case startTime = "StartTime"
            case timeZoneId = "TimeZoneId"
        }
    }

    public struct HandOffTime: AWSEncodableShape & AWSDecodableShape {
        /// The hour when an on-call rotation shift begins or ends.
        public let hourOfDay: Int
        /// The minute when an on-call rotation shift begins or ends.
        public let minuteOfHour: Int

        @inlinable
        public init(hourOfDay: Int, minuteOfHour: Int) {
            self.hourOfDay = hourOfDay
            self.minuteOfHour = minuteOfHour
        }

        public func validate(name: String) throws {
            try self.validate(self.hourOfDay, name: "hourOfDay", parent: name, max: 23)
            try self.validate(self.hourOfDay, name: "hourOfDay", parent: name, min: 0)
            try self.validate(self.minuteOfHour, name: "minuteOfHour", parent: name, max: 59)
            try self.validate(self.minuteOfHour, name: "minuteOfHour", parent: name, min: 0)
        }

        private enum CodingKeys: String, CodingKey {
            case hourOfDay = "HourOfDay"
            case minuteOfHour = "MinuteOfHour"
        }
    }

    public struct InternalServerException: AWSErrorShape {
        public let message: String
        /// Advice to clients on when the call can be safely retried
        public let retryAfterSeconds: Int?

        @inlinable
        public init(message: String, retryAfterSeconds: Int? = nil) {
            self.message = message
            self.retryAfterSeconds = retryAfterSeconds
        }

        public init(from decoder: Decoder) throws {
            let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer
            let container = try decoder.container(keyedBy: CodingKeys.self)
            self.message = try container.decode(String.self, forKey: .message)
            self.retryAfterSeconds = try response.decodeHeaderIfPresent(Int.self, key: "Retry-After")
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
        }
    }

    public struct ListContactChannelsRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact.
        public let contactId: String
        /// The maximum number of contact channels per page.
        public let maxResults: Int?
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?

        @inlinable
        public init(contactId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.contactId = contactId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.contactId, name: "contactId", parent: name, max: 2048)
            try self.validate(self.contactId, name: "contactId", parent: name, min: 1)
            try self.validate(self.contactId, name: "contactId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactId = "ContactId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListContactChannelsResult: AWSDecodableShape {
        /// A list of contact channels related to the specified contact.
        public let contactChannels: [ContactChannel]
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?

        @inlinable
        public init(contactChannels: [ContactChannel], nextToken: String? = nil) {
            self.contactChannels = contactChannels
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannels = "ContactChannels"
            case nextToken = "NextToken"
        }
    }

    public struct ListContactsRequest: AWSEncodableShape {
        /// Used to list only contacts who's aliases start with the specified prefix.
        public let aliasPrefix: String?
        /// The maximum number of contacts and escalation plans per page of results.
        public let maxResults: Int?
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?
        /// The type of contact.
        public let type: ContactType?

        @inlinable
        public init(aliasPrefix: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, type: ContactType? = nil) {
            self.aliasPrefix = aliasPrefix
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.type = type
        }

        public func validate(name: String) throws {
            try self.validate(self.aliasPrefix, name: "aliasPrefix", parent: name, max: 255)
            try self.validate(self.aliasPrefix, name: "aliasPrefix", parent: name, min: 1)
            try self.validate(self.aliasPrefix, name: "aliasPrefix", parent: name, pattern: "^[a-z0-9_\\-]*$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case aliasPrefix = "AliasPrefix"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case type = "Type"
        }
    }

    public struct ListContactsResult: AWSDecodableShape {
        /// A list of the contacts and escalation plans in your Incident Manager account.
        public let contacts: [Contact]?
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?

        @inlinable
        public init(contacts: [Contact]? = nil, nextToken: String? = nil) {
            self.contacts = contacts
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case contacts = "Contacts"
            case nextToken = "NextToken"
        }
    }

    public struct ListEngagementsRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the incident you're listing engagements for.
        public let incidentId: String?
        /// The maximum number of engagements per page of results.
        public let maxResults: Int?
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?
        /// The time range to lists engagements for an incident.
        public let timeRangeValue: TimeRange?

        @inlinable
        public init(incidentId: String? = nil, maxResults: Int? = nil, nextToken: String? = nil, timeRangeValue: TimeRange? = nil) {
            self.incidentId = incidentId
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.timeRangeValue = timeRangeValue
        }

        public func validate(name: String) throws {
            try self.validate(self.incidentId, name: "incidentId", parent: name, max: 1024)
            try self.validate(self.incidentId, name: "incidentId", parent: name, pattern: "^[\\\\a-zA-Z0-9_@#%*+=:?.\\/!\\s-]*$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case incidentId = "IncidentId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case timeRangeValue = "TimeRangeValue"
        }
    }

    public struct ListEngagementsResult: AWSDecodableShape {
        /// A list of each engagement that occurred during the specified time range of an incident.
        public let engagements: [Engagement]
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?

        @inlinable
        public init(engagements: [Engagement], nextToken: String? = nil) {
            self.engagements = engagements
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case engagements = "Engagements"
            case nextToken = "NextToken"
        }
    }

    public struct ListPageReceiptsRequest: AWSEncodableShape {
        /// The maximum number of acknowledgements per page of results.
        public let maxResults: Int?
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?
        /// The Amazon Resource Name (ARN) of the engagement to a specific contact channel.
        public let pageId: String

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, pageId: String) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.pageId = pageId
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.pageId, name: "pageId", parent: name, max: 2048)
            try self.validate(self.pageId, name: "pageId", parent: name, min: 1)
            try self.validate(self.pageId, name: "pageId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case pageId = "PageId"
        }
    }

    public struct ListPageReceiptsResult: AWSDecodableShape {
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?
        /// A list of each acknowledgement.
        public let receipts: [Receipt]?

        @inlinable
        public init(nextToken: String? = nil, receipts: [Receipt]? = nil) {
            self.nextToken = nextToken
            self.receipts = receipts
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case receipts = "Receipts"
        }
    }

    public struct ListPageResolutionsRequest: AWSEncodableShape {
        /// A token to start the list. Use this token to get the next set of results.
        public let nextToken: String?
        /// The Amazon Resource Name (ARN) of the contact engaged for the incident.
        public let pageId: String

        @inlinable
        public init(nextToken: String? = nil, pageId: String) {
            self.nextToken = nextToken
            self.pageId = pageId
        }

        public func validate(name: String) throws {
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.pageId, name: "pageId", parent: name, max: 2048)
            try self.validate(self.pageId, name: "pageId", parent: name, min: 1)
            try self.validate(self.pageId, name: "pageId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case pageId = "PageId"
        }
    }

    public struct ListPageResolutionsResult: AWSDecodableShape {
        /// The token for the next set of items to return. Use this token to get the next set of results.
        public let nextToken: String?
        /// Information about the resolution for an engagement.
        public let pageResolutions: [ResolutionContact]

        @inlinable
        public init(nextToken: String? = nil, pageResolutions: [ResolutionContact]) {
            self.nextToken = nextToken
            self.pageResolutions = pageResolutions
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case pageResolutions = "PageResolutions"
        }
    }

    public struct ListPagesByContactRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact you are retrieving engagements for.
        public let contactId: String
        /// The maximum number of engagements to contact channels to list per page of results.
        public let maxResults: Int?
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?

        @inlinable
        public init(contactId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.contactId = contactId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.contactId, name: "contactId", parent: name, max: 2048)
            try self.validate(self.contactId, name: "contactId", parent: name, min: 1)
            try self.validate(self.contactId, name: "contactId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactId = "ContactId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListPagesByContactResult: AWSDecodableShape {
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?
        /// The list of engagements to a contact's contact channel.
        public let pages: [Page]

        @inlinable
        public init(nextToken: String? = nil, pages: [Page]) {
            self.nextToken = nextToken
            self.pages = pages
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case pages = "Pages"
        }
    }

    public struct ListPagesByEngagementRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the engagement.
        public let engagementId: String
        /// The maximum number of engagements to contact channels to list per page of results.
        public let maxResults: Int?
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?

        @inlinable
        public init(engagementId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.engagementId = engagementId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func validate(name: String) throws {
            try self.validate(self.engagementId, name: "engagementId", parent: name, max: 2048)
            try self.validate(self.engagementId, name: "engagementId", parent: name, min: 1)
            try self.validate(self.engagementId, name: "engagementId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case engagementId = "EngagementId"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
        }
    }

    public struct ListPagesByEngagementResult: AWSDecodableShape {
        /// The pagination token to continue to the next page of results.
        public let nextToken: String?
        /// The list of engagements to contact channels.
        public let pages: [Page]

        @inlinable
        public init(nextToken: String? = nil, pages: [Page]) {
            self.nextToken = nextToken
            self.pages = pages
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case pages = "Pages"
        }
    }

    public struct ListPreviewRotationShiftsRequest: AWSEncodableShape {
        /// The date and time a rotation shift would end.
        public let endTime: Date
        /// The maximum number of items to return for this call. The call also returns a token that can be specified in a subsequent call to get the next set of results.
        public let maxResults: Int?
        /// The contacts that would be assigned to a rotation.
        public let members: [String]
        /// A token to start the list. This token is used to get the next set of results.
        public let nextToken: String?
        /// Information about changes that would be made in a rotation override.
        public let overrides: [PreviewOverride]?
        /// Information about how long a rotation would last before restarting at the beginning of the shift order.
        public let recurrence: RecurrenceSettings
        /// The date and time a rotation would begin. The first shift is calculated from this date and time.
        public let rotationStartTime: Date?
        /// Used to filter the range of calculated shifts before sending the response back to the user.
        public let startTime: Date?
        /// The time zone the rotation’s activity would be based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul".
        public let timeZoneId: String

        @inlinable
        public init(endTime: Date, maxResults: Int? = nil, members: [String], nextToken: String? = nil, overrides: [PreviewOverride]? = nil, recurrence: RecurrenceSettings, rotationStartTime: Date? = nil, startTime: Date? = nil, timeZoneId: String) {
            self.endTime = endTime
            self.maxResults = maxResults
            self.members = members
            self.nextToken = nextToken
            self.overrides = overrides
            self.recurrence = recurrence
            self.rotationStartTime = rotationStartTime
            self.startTime = startTime
            self.timeZoneId = timeZoneId
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.members.forEach {
                try validate($0, name: "members[]", parent: name, max: 512)
                try validate($0, name: "members[]", parent: name, min: 1)
                try validate($0, name: "members[]", parent: name, pattern: "\\S")
            }
            try self.validate(self.members, name: "members", parent: name, max: 30)
            try self.validate(self.members, name: "members", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.overrides?.forEach {
                try $0.validate(name: "\(name).overrides[]")
            }
            try self.recurrence.validate(name: "\(name).recurrence")
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, max: 255)
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, min: 1)
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, pattern: "^[:a-zA-Z0-9_\\-\\s\\.\\\\/]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case maxResults = "MaxResults"
            case members = "Members"
            case nextToken = "NextToken"
            case overrides = "Overrides"
            case recurrence = "Recurrence"
            case rotationStartTime = "RotationStartTime"
            case startTime = "StartTime"
            case timeZoneId = "TimeZoneId"
        }
    }

    public struct ListPreviewRotationShiftsResult: AWSDecodableShape {
        /// The token for the next set of items to return. This token is used to get the next set of results.
        public let nextToken: String?
        /// Details about a rotation shift, including times, types, and contacts.
        public let rotationShifts: [RotationShift]?

        @inlinable
        public init(nextToken: String? = nil, rotationShifts: [RotationShift]? = nil) {
            self.nextToken = nextToken
            self.rotationShifts = rotationShifts
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case rotationShifts = "RotationShifts"
        }
    }

    public struct ListRotationOverridesRequest: AWSEncodableShape {
        /// The date and time for the end of a time range for listing overrides.
        public let endTime: Date
        /// The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
        public let maxResults: Int?
        /// A token to start the list. Use this token to get the next set of results.
        public let nextToken: String?
        /// The Amazon Resource Name (ARN) of the rotation to retrieve information about.
        public let rotationId: String
        /// The date and time for the beginning of a time range for listing overrides.
        public let startTime: Date

        @inlinable
        public init(endTime: Date, maxResults: Int? = nil, nextToken: String? = nil, rotationId: String, startTime: Date) {
            self.endTime = endTime
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.rotationId = rotationId
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.rotationId, name: "rotationId", parent: name, max: 2048)
            try self.validate(self.rotationId, name: "rotationId", parent: name, min: 1)
            try self.validate(self.rotationId, name: "rotationId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case rotationId = "RotationId"
            case startTime = "StartTime"
        }
    }

    public struct ListRotationOverridesResult: AWSDecodableShape {
        /// The token for the next set of items to return. Use this token to get the next set of results.
        public let nextToken: String?
        /// A list of rotation overrides in the specified time range.
        public let rotationOverrides: [RotationOverride]?

        @inlinable
        public init(nextToken: String? = nil, rotationOverrides: [RotationOverride]? = nil) {
            self.nextToken = nextToken
            self.rotationOverrides = rotationOverrides
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case rotationOverrides = "RotationOverrides"
        }
    }

    public struct ListRotationShiftsRequest: AWSEncodableShape {
        /// The date and time for the end of the time range to list shifts for.
        public let endTime: Date
        /// The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
        public let maxResults: Int?
        /// A token to start the list. Use this token to get the next set of results.
        public let nextToken: String?
        /// The Amazon Resource Name (ARN) of the rotation to retrieve shift information about.
        public let rotationId: String
        /// The date and time for the beginning of the time range to list shifts for.
        public let startTime: Date?

        @inlinable
        public init(endTime: Date, maxResults: Int? = nil, nextToken: String? = nil, rotationId: String, startTime: Date? = nil) {
            self.endTime = endTime
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.rotationId = rotationId
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.rotationId, name: "rotationId", parent: name, max: 2048)
            try self.validate(self.rotationId, name: "rotationId", parent: name, min: 1)
            try self.validate(self.rotationId, name: "rotationId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case rotationId = "RotationId"
            case startTime = "StartTime"
        }
    }

    public struct ListRotationShiftsResult: AWSDecodableShape {
        /// The token for the next set of items to return. Use this token to get the next set of results.
        public let nextToken: String?
        /// Information about shifts that meet the filter criteria.
        public let rotationShifts: [RotationShift]?

        @inlinable
        public init(nextToken: String? = nil, rotationShifts: [RotationShift]? = nil) {
            self.nextToken = nextToken
            self.rotationShifts = rotationShifts
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case rotationShifts = "RotationShifts"
        }
    }

    public struct ListRotationsRequest: AWSEncodableShape {
        /// The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.
        public let maxResults: Int?
        /// A token to start the list. Use this token to get the next set of results.
        public let nextToken: String?
        /// A filter to include rotations in list results based on their common prefix. For example, entering prod returns a list of all rotation names that begin with prod, such as production and prod-1.
        public let rotationNamePrefix: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, rotationNamePrefix: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.rotationNamePrefix = rotationNamePrefix
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 1024)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 0)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2048)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.rotationNamePrefix, name: "rotationNamePrefix", parent: name, max: 255)
            try self.validate(self.rotationNamePrefix, name: "rotationNamePrefix", parent: name, min: 1)
            try self.validate(self.rotationNamePrefix, name: "rotationNamePrefix", parent: name, pattern: "^[a-zA-Z0-9_\\-\\s\\.]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case maxResults = "MaxResults"
            case nextToken = "NextToken"
            case rotationNamePrefix = "RotationNamePrefix"
        }
    }

    public struct ListRotationsResult: AWSDecodableShape {
        /// The token for the next set of items to return. Use this token to get the next set of results.
        public let nextToken: String?
        /// Information about rotations that meet the filter criteria.
        public let rotations: [Rotation]

        @inlinable
        public init(nextToken: String? = nil, rotations: [Rotation]) {
            self.nextToken = nextToken
            self.rotations = rotations
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "NextToken"
            case rotations = "Rotations"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact, escalation plan, rotation, or on-call schedule.
        public let resourceARN: String

        @inlinable
        public init(resourceARN: String) {
            self.resourceARN = resourceARN
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
        }
    }

    public struct ListTagsForResourceResult: AWSDecodableShape {
        /// The tags related to the contact or escalation plan.
        public let tags: [Tag]?

        @inlinable
        public init(tags: [Tag]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "Tags"
        }
    }

    public struct MonthlySetting: AWSEncodableShape & AWSDecodableShape {
        /// The day of the month when monthly recurring on-call rotations begin.
        public let dayOfMonth: Int
        /// The time of day when a monthly recurring on-call shift rotation begins.
        public let handOffTime: HandOffTime

        @inlinable
        public init(dayOfMonth: Int, handOffTime: HandOffTime) {
            self.dayOfMonth = dayOfMonth
            self.handOffTime = handOffTime
        }

        public func validate(name: String) throws {
            try self.validate(self.dayOfMonth, name: "dayOfMonth", parent: name, max: 31)
            try self.validate(self.dayOfMonth, name: "dayOfMonth", parent: name, min: 1)
            try self.handOffTime.validate(name: "\(name).handOffTime")
        }

        private enum CodingKeys: String, CodingKey {
            case dayOfMonth = "DayOfMonth"
            case handOffTime = "HandOffTime"
        }
    }

    public struct Page: AWSDecodableShape {
        /// The ARN of the contact that Incident Manager is engaging.
        public let contactArn: String
        /// The time the message was delivered to the contact channel.
        public let deliveryTime: Date?
        /// The ARN of the engagement that this page is part of.
        public let engagementArn: String
        /// The ARN of the incident that's engaging the contact channel.
        public let incidentId: String?
        /// The Amazon Resource Name (ARN) of the page to the contact channel.
        public let pageArn: String
        /// The time that the contact channel acknowledged engagement.
        public let readTime: Date?
        /// The user that started the engagement.
        public let sender: String
        /// The time that Incident Manager engaged the contact channel.
        public let sentTime: Date?

        @inlinable
        public init(contactArn: String, deliveryTime: Date? = nil, engagementArn: String, incidentId: String? = nil, pageArn: String, readTime: Date? = nil, sender: String, sentTime: Date? = nil) {
            self.contactArn = contactArn
            self.deliveryTime = deliveryTime
            self.engagementArn = engagementArn
            self.incidentId = incidentId
            self.pageArn = pageArn
            self.readTime = readTime
            self.sender = sender
            self.sentTime = sentTime
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
            case deliveryTime = "DeliveryTime"
            case engagementArn = "EngagementArn"
            case incidentId = "IncidentId"
            case pageArn = "PageArn"
            case readTime = "ReadTime"
            case sender = "Sender"
            case sentTime = "SentTime"
        }
    }

    public struct Plan: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon Resource Names (ARNs) of the on-call rotations associated with the plan.
        public let rotationIds: [String]?
        /// A list of stages that the escalation plan or engagement plan uses to engage contacts and contact methods.
        public let stages: [Stage]?

        @inlinable
        public init(rotationIds: [String]? = nil, stages: [Stage]? = nil) {
            self.rotationIds = rotationIds
            self.stages = stages
        }

        public func validate(name: String) throws {
            try self.rotationIds?.forEach {
                try validate($0, name: "rotationIds[]", parent: name, max: 2048)
                try validate($0, name: "rotationIds[]", parent: name, min: 1)
                try validate($0, name: "rotationIds[]", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            }
            try self.validate(self.rotationIds, name: "rotationIds", parent: name, max: 25)
            try self.stages?.forEach {
                try $0.validate(name: "\(name).stages[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case rotationIds = "RotationIds"
            case stages = "Stages"
        }
    }

    public struct PreviewOverride: AWSEncodableShape {
        /// Information about the time a rotation override would end.
        public let endTime: Date?
        /// Information about contacts to add to an on-call rotation override.
        public let newMembers: [String]?
        /// Information about the time a rotation override would begin.
        public let startTime: Date?

        @inlinable
        public init(endTime: Date? = nil, newMembers: [String]? = nil, startTime: Date? = nil) {
            self.endTime = endTime
            self.newMembers = newMembers
            self.startTime = startTime
        }

        public func validate(name: String) throws {
            try self.newMembers?.forEach {
                try validate($0, name: "newMembers[]", parent: name, max: 512)
                try validate($0, name: "newMembers[]", parent: name, min: 1)
                try validate($0, name: "newMembers[]", parent: name, pattern: "\\S")
            }
            try self.validate(self.newMembers, name: "newMembers", parent: name, max: 30)
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case newMembers = "NewMembers"
            case startTime = "StartTime"
        }
    }

    public struct PutContactPolicyRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact or escalation plan.
        public let contactArn: String
        /// Details of the resource policy.
        public let policy: String

        @inlinable
        public init(contactArn: String, policy: String) {
            self.contactArn = contactArn
            self.policy = policy
        }

        public func validate(name: String) throws {
            try self.validate(self.contactArn, name: "contactArn", parent: name, max: 2048)
            try self.validate(self.contactArn, name: "contactArn", parent: name, min: 1)
            try self.validate(self.contactArn, name: "contactArn", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.policy, name: "policy", parent: name, max: 395000)
            try self.validate(self.policy, name: "policy", parent: name, min: 1)
            try self.validate(self.policy, name: "policy", parent: name, pattern: "\\S")
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
            case policy = "Policy"
        }
    }

    public struct PutContactPolicyResult: AWSDecodableShape {
        public init() {}
    }

    public struct Receipt: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of the contact channel Incident Manager engaged.
        public let contactChannelArn: String?
        /// Information provided during the page acknowledgement.
        public let receiptInfo: String?
        /// The time receipt was SENT, DELIVERED, or READ.
        public let receiptTime: Date
        /// The type follows the engagement cycle, SENT, DELIVERED, and READ.
        public let receiptType: ReceiptType

        @inlinable
        public init(contactChannelArn: String? = nil, receiptInfo: String? = nil, receiptTime: Date, receiptType: ReceiptType) {
            self.contactChannelArn = contactChannelArn
            self.receiptInfo = receiptInfo
            self.receiptTime = receiptTime
            self.receiptType = receiptType
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannelArn = "ContactChannelArn"
            case receiptInfo = "ReceiptInfo"
            case receiptTime = "ReceiptTime"
            case receiptType = "ReceiptType"
        }
    }

    public struct RecurrenceSettings: AWSEncodableShape & AWSDecodableShape {
        /// Information about on-call rotations that recur daily.
        public let dailySettings: [HandOffTime]?
        /// Information about on-call rotations that recur monthly.
        public let monthlySettings: [MonthlySetting]?
        /// The number of contacts, or shift team members designated to be on call concurrently during a shift. For example, in an on-call schedule that contains ten contacts, a value of 2 designates that two of them are on call at any given time.
        public let numberOfOnCalls: Int
        /// The number of days, weeks, or months a single rotation lasts.
        public let recurrenceMultiplier: Int
        /// Information about the days of the week that the on-call rotation coverage includes.
        public let shiftCoverages: [DayOfWeek: [CoverageTime]]?
        /// Information about on-call rotations that recur weekly.
        public let weeklySettings: [WeeklySetting]?

        @inlinable
        public init(dailySettings: [HandOffTime]? = nil, monthlySettings: [MonthlySetting]? = nil, numberOfOnCalls: Int, recurrenceMultiplier: Int, shiftCoverages: [DayOfWeek: [CoverageTime]]? = nil, weeklySettings: [WeeklySetting]? = nil) {
            self.dailySettings = dailySettings
            self.monthlySettings = monthlySettings
            self.numberOfOnCalls = numberOfOnCalls
            self.recurrenceMultiplier = recurrenceMultiplier
            self.shiftCoverages = shiftCoverages
            self.weeklySettings = weeklySettings
        }

        public func validate(name: String) throws {
            try self.dailySettings?.forEach {
                try $0.validate(name: "\(name).dailySettings[]")
            }
            try self.monthlySettings?.forEach {
                try $0.validate(name: "\(name).monthlySettings[]")
            }
            try self.validate(self.numberOfOnCalls, name: "numberOfOnCalls", parent: name, min: 1)
            try self.validate(self.recurrenceMultiplier, name: "recurrenceMultiplier", parent: name, max: 100)
            try self.validate(self.recurrenceMultiplier, name: "recurrenceMultiplier", parent: name, min: 1)
            try self.weeklySettings?.forEach {
                try $0.validate(name: "\(name).weeklySettings[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case dailySettings = "DailySettings"
            case monthlySettings = "MonthlySettings"
            case numberOfOnCalls = "NumberOfOnCalls"
            case recurrenceMultiplier = "RecurrenceMultiplier"
            case shiftCoverages = "ShiftCoverages"
            case weeklySettings = "WeeklySettings"
        }
    }

    public struct ResolutionContact: AWSDecodableShape {
        /// The Amazon Resource Name (ARN) of a contact in the engagement resolution process.
        public let contactArn: String
        /// The stage in the escalation plan that resolves to this contact.
        public let stageIndex: Int?
        /// The type of contact for a resolution step.
        public let type: ContactType

        @inlinable
        public init(contactArn: String, stageIndex: Int? = nil, type: ContactType) {
            self.contactArn = contactArn
            self.stageIndex = stageIndex
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case contactArn = "ContactArn"
            case stageIndex = "StageIndex"
            case type = "Type"
        }
    }

    public struct ResourceNotFoundException: AWSErrorShape {
        public let message: String
        /// Hypothetical resource identifier that was not found
        public let resourceId: String
        /// Hypothetical resource type that was not found
        public let resourceType: String

        @inlinable
        public init(message: String, resourceId: String, resourceType: String) {
            self.message = message
            self.resourceId = resourceId
            self.resourceType = resourceType
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case resourceId = "ResourceId"
            case resourceType = "ResourceType"
        }
    }

    public struct Rotation: AWSDecodableShape {
        /// The Amazon Resource Names (ARNs) of the contacts assigned to the rotation team.
        public let contactIds: [String]?
        /// The name of the rotation.
        public let name: String
        /// Information about when an on-call rotation is in effect and how long the rotation period lasts.
        public let recurrence: RecurrenceSettings?
        /// The Amazon Resource Name (ARN) of the rotation.
        public let rotationArn: String
        /// The date and time the rotation becomes active.
        public let startTime: Date?
        /// The time zone the rotation’s activity is based on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul".
        public let timeZoneId: String?

        @inlinable
        public init(contactIds: [String]? = nil, name: String, recurrence: RecurrenceSettings? = nil, rotationArn: String, startTime: Date? = nil, timeZoneId: String? = nil) {
            self.contactIds = contactIds
            self.name = name
            self.recurrence = recurrence
            self.rotationArn = rotationArn
            self.startTime = startTime
            self.timeZoneId = timeZoneId
        }

        private enum CodingKeys: String, CodingKey {
            case contactIds = "ContactIds"
            case name = "Name"
            case recurrence = "Recurrence"
            case rotationArn = "RotationArn"
            case startTime = "StartTime"
            case timeZoneId = "TimeZoneId"
        }
    }

    public struct RotationOverride: AWSDecodableShape {
        /// The time a rotation override was created.
        public let createTime: Date
        /// The time a rotation override ends.
        public let endTime: Date
        /// The Amazon Resource Names (ARNs) of the contacts assigned to the override of the on-call rotation.
        public let newContactIds: [String]
        /// The Amazon Resource Name (ARN) of the override to an on-call rotation.
        public let rotationOverrideId: String
        /// The time a rotation override begins.
        public let startTime: Date

        @inlinable
        public init(createTime: Date, endTime: Date, newContactIds: [String], rotationOverrideId: String, startTime: Date) {
            self.createTime = createTime
            self.endTime = endTime
            self.newContactIds = newContactIds
            self.rotationOverrideId = rotationOverrideId
            self.startTime = startTime
        }

        private enum CodingKeys: String, CodingKey {
            case createTime = "CreateTime"
            case endTime = "EndTime"
            case newContactIds = "NewContactIds"
            case rotationOverrideId = "RotationOverrideId"
            case startTime = "StartTime"
        }
    }

    public struct RotationShift: AWSDecodableShape {
        /// The Amazon Resource Names (ARNs) of the contacts who are part of the shift rotation.
        public let contactIds: [String]?
        /// The time a shift rotation ends.
        public let endTime: Date
        /// Additional information about an on-call rotation shift.
        public let shiftDetails: ShiftDetails?
        /// The time a shift rotation begins.
        public let startTime: Date
        /// The type of shift rotation.
        public let type: ShiftType?

        @inlinable
        public init(contactIds: [String]? = nil, endTime: Date, shiftDetails: ShiftDetails? = nil, startTime: Date, type: ShiftType? = nil) {
            self.contactIds = contactIds
            self.endTime = endTime
            self.shiftDetails = shiftDetails
            self.startTime = startTime
            self.type = type
        }

        private enum CodingKeys: String, CodingKey {
            case contactIds = "ContactIds"
            case endTime = "EndTime"
            case shiftDetails = "ShiftDetails"
            case startTime = "StartTime"
            case type = "Type"
        }
    }

    public struct SendActivationCodeRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact channel.
        public let contactChannelId: String

        @inlinable
        public init(contactChannelId: String) {
            self.contactChannelId = contactChannelId
        }

        public func validate(name: String) throws {
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, max: 2048)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, min: 1)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannelId = "ContactChannelId"
        }
    }

    public struct SendActivationCodeResult: AWSDecodableShape {
        public init() {}
    }

    public struct ServiceQuotaExceededException: AWSErrorShape {
        public let message: String
        /// Service Quotas requirement to identify originating service
        public let quotaCode: String
        /// Identifier of the resource affected
        public let resourceId: String?
        /// Type of the resource affected
        public let resourceType: String?
        /// Service Quotas requirement to identify originating quota
        public let serviceCode: String

        @inlinable
        public init(message: String, quotaCode: String, resourceId: String? = nil, resourceType: String? = nil, serviceCode: String) {
            self.message = message
            self.quotaCode = quotaCode
            self.resourceId = resourceId
            self.resourceType = resourceType
            self.serviceCode = serviceCode
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case quotaCode = "QuotaCode"
            case resourceId = "ResourceId"
            case resourceType = "ResourceType"
            case serviceCode = "ServiceCode"
        }
    }

    public struct ShiftDetails: AWSDecodableShape {
        /// The Amazon Resources Names (ARNs) of the contacts who were replaced in a shift when an override was created. If the override is deleted, these contacts are restored to the shift.
        public let overriddenContactIds: [String]

        @inlinable
        public init(overriddenContactIds: [String]) {
            self.overriddenContactIds = overriddenContactIds
        }

        private enum CodingKeys: String, CodingKey {
            case overriddenContactIds = "OverriddenContactIds"
        }
    }

    public struct Stage: AWSEncodableShape & AWSDecodableShape {
        /// The time to wait until beginning the next stage. The duration can only be set to 0 if a target is specified.
        public let durationInMinutes: Int
        /// The contacts or contact methods that the escalation plan or engagement plan is engaging.
        public let targets: [Target]

        @inlinable
        public init(durationInMinutes: Int, targets: [Target]) {
            self.durationInMinutes = durationInMinutes
            self.targets = targets
        }

        public func validate(name: String) throws {
            try self.validate(self.durationInMinutes, name: "durationInMinutes", parent: name, max: 30)
            try self.validate(self.durationInMinutes, name: "durationInMinutes", parent: name, min: 0)
            try self.targets.forEach {
                try $0.validate(name: "\(name).targets[]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case durationInMinutes = "DurationInMinutes"
            case targets = "Targets"
        }
    }

    public struct StartEngagementRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact being engaged.
        public let contactId: String
        /// The secure content of the message that was sent to the contact. Use this field for engagements to VOICE or EMAIL.
        public let content: String
        /// A token ensuring that the operation is called only once with the specified details.
        public let idempotencyToken: String?
        /// The ARN of the incident that the engagement is part of.
        public let incidentId: String?
        /// The insecure content of the message that was sent to the contact. Use this field for engagements to SMS.
        public let publicContent: String?
        /// The insecure subject of the message that was sent to the contact. Use this field for engagements to SMS.
        public let publicSubject: String?
        /// The user that started the engagement.
        public let sender: String
        /// The secure subject of the message that was sent to the contact. Use this field for engagements to VOICE or EMAIL.
        public let subject: String

        @inlinable
        public init(contactId: String, content: String, idempotencyToken: String? = StartEngagementRequest.idempotencyToken(), incidentId: String? = nil, publicContent: String? = nil, publicSubject: String? = nil, sender: String, subject: String) {
            self.contactId = contactId
            self.content = content
            self.idempotencyToken = idempotencyToken
            self.incidentId = incidentId
            self.publicContent = publicContent
            self.publicSubject = publicSubject
            self.sender = sender
            self.subject = subject
        }

        public func validate(name: String) throws {
            try self.validate(self.contactId, name: "contactId", parent: name, max: 2048)
            try self.validate(self.contactId, name: "contactId", parent: name, min: 1)
            try self.validate(self.contactId, name: "contactId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.content, name: "content", parent: name, max: 8192)
            try self.validate(self.content, name: "content", parent: name, min: 1)
            try self.validate(self.content, name: "content", parent: name, pattern: "^[.\\s\\S]*$")
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, max: 2048)
            try self.validate(self.idempotencyToken, name: "idempotencyToken", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.incidentId, name: "incidentId", parent: name, max: 1024)
            try self.validate(self.incidentId, name: "incidentId", parent: name, pattern: "^[\\\\a-zA-Z0-9_@#%*+=:?.\\/!\\s-]*$")
            try self.validate(self.publicContent, name: "publicContent", parent: name, max: 8192)
            try self.validate(self.publicContent, name: "publicContent", parent: name, min: 1)
            try self.validate(self.publicContent, name: "publicContent", parent: name, pattern: "^[.\\s\\S]*$")
            try self.validate(self.publicSubject, name: "publicSubject", parent: name, max: 2048)
            try self.validate(self.publicSubject, name: "publicSubject", parent: name, min: 1)
            try self.validate(self.publicSubject, name: "publicSubject", parent: name, pattern: "^[.\\s\\S]*$")
            try self.validate(self.sender, name: "sender", parent: name, max: 255)
            try self.validate(self.sender, name: "sender", parent: name, pattern: "^[\\\\a-zA-Z0-9_@#%*+=:?.\\/!\\s-]*$")
            try self.validate(self.subject, name: "subject", parent: name, max: 2048)
            try self.validate(self.subject, name: "subject", parent: name, min: 1)
            try self.validate(self.subject, name: "subject", parent: name, pattern: "^[.\\s\\S]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactId = "ContactId"
            case content = "Content"
            case idempotencyToken = "IdempotencyToken"
            case incidentId = "IncidentId"
            case publicContent = "PublicContent"
            case publicSubject = "PublicSubject"
            case sender = "Sender"
            case subject = "Subject"
        }
    }

    public struct StartEngagementResult: AWSDecodableShape {
        /// The ARN of the engagement.
        public let engagementArn: String

        @inlinable
        public init(engagementArn: String) {
            self.engagementArn = engagementArn
        }

        private enum CodingKeys: String, CodingKey {
            case engagementArn = "EngagementArn"
        }
    }

    public struct StopEngagementRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the engagement.
        public let engagementId: String
        /// The reason that you're stopping the engagement.
        public let reason: String?

        @inlinable
        public init(engagementId: String, reason: String? = nil) {
            self.engagementId = engagementId
            self.reason = reason
        }

        public func validate(name: String) throws {
            try self.validate(self.engagementId, name: "engagementId", parent: name, max: 2048)
            try self.validate(self.engagementId, name: "engagementId", parent: name, min: 1)
            try self.validate(self.engagementId, name: "engagementId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.reason, name: "reason", parent: name, max: 255)
            try self.validate(self.reason, name: "reason", parent: name, pattern: "^[.\\s\\S]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case engagementId = "EngagementId"
            case reason = "Reason"
        }
    }

    public struct StopEngagementResult: AWSDecodableShape {
        public init() {}
    }

    public struct Tag: AWSEncodableShape & AWSDecodableShape {
        /// Name of the object key.
        public let key: String?
        /// Value of the tag.
        public let value: String?

        @inlinable
        public init(key: String? = nil, value: String? = nil) {
            self.key = key
            self.value = value
        }

        public func validate(name: String) throws {
            try self.validate(self.key, name: "key", parent: name, max: 128)
            try self.validate(self.key, name: "key", parent: name, min: 1)
            try self.validate(self.key, name: "key", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            try self.validate(self.value, name: "value", parent: name, max: 256)
            try self.validate(self.value, name: "value", parent: name, min: 1)
            try self.validate(self.value, name: "value", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case key = "Key"
            case value = "Value"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact or escalation plan.
        public let resourceARN: String
        /// A list of tags that you are adding to the contact or escalation plan.
        public let tags: [Tag]

        @inlinable
        public init(resourceARN: String, tags: [Tag]) {
            self.resourceARN = resourceARN
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tags.forEach {
                try $0.validate(name: "\(name).tags[]")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tags = "Tags"
        }
    }

    public struct TagResourceResult: AWSDecodableShape {
        public init() {}
    }

    public struct Target: AWSEncodableShape & AWSDecodableShape {
        /// Information about the contact channel that Incident Manager engages.
        public let channelTargetInfo: ChannelTargetInfo?
        /// Information about the contact that Incident Manager engages.
        public let contactTargetInfo: ContactTargetInfo?

        @inlinable
        public init(channelTargetInfo: ChannelTargetInfo? = nil, contactTargetInfo: ContactTargetInfo? = nil) {
            self.channelTargetInfo = channelTargetInfo
            self.contactTargetInfo = contactTargetInfo
        }

        public func validate(name: String) throws {
            try self.channelTargetInfo?.validate(name: "\(name).channelTargetInfo")
            try self.contactTargetInfo?.validate(name: "\(name).contactTargetInfo")
        }

        private enum CodingKeys: String, CodingKey {
            case channelTargetInfo = "ChannelTargetInfo"
            case contactTargetInfo = "ContactTargetInfo"
        }
    }

    public struct ThrottlingException: AWSErrorShape {
        public let message: String
        /// Service Quotas requirement to identify originating service
        public let quotaCode: String?
        /// Advice to clients on when the call can be safely retried
        public let retryAfterSeconds: Int?
        /// Service Quotas requirement to identify originating quota
        public let serviceCode: String?

        @inlinable
        public init(message: String, quotaCode: String? = nil, retryAfterSeconds: Int? = nil, serviceCode: String? = nil) {
            self.message = message
            self.quotaCode = quotaCode
            self.retryAfterSeconds = retryAfterSeconds
            self.serviceCode = serviceCode
        }

        public init(from decoder: Decoder) throws {
            let response = decoder.userInfo[.awsResponse]! as! ResponseDecodingContainer
            let container = try decoder.container(keyedBy: CodingKeys.self)
            self.message = try container.decode(String.self, forKey: .message)
            self.quotaCode = try container.decodeIfPresent(String.self, forKey: .quotaCode)
            self.retryAfterSeconds = try response.decodeHeaderIfPresent(Int.self, key: "Retry-After")
            self.serviceCode = try container.decodeIfPresent(String.self, forKey: .serviceCode)
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case quotaCode = "QuotaCode"
            case serviceCode = "ServiceCode"
        }
    }

    public struct TimeRange: AWSEncodableShape {
        /// The end of the time range.
        public let endTime: Date?
        /// The start of the time range.
        public let startTime: Date?

        @inlinable
        public init(endTime: Date? = nil, startTime: Date? = nil) {
            self.endTime = endTime
            self.startTime = startTime
        }

        private enum CodingKeys: String, CodingKey {
            case endTime = "EndTime"
            case startTime = "StartTime"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact or escalation plan.
        public let resourceARN: String
        /// The key of the tag that you want to remove.
        public let tagKeys: [String]

        @inlinable
        public init(resourceARN: String, tagKeys: [String]) {
            self.resourceARN = resourceARN
            self.tagKeys = tagKeys
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, max: 1011)
            try self.validate(self.resourceARN, name: "resourceARN", parent: name, min: 1)
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^[\\\\\\/a-zA-Z0-9_+=\\-]*$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case resourceARN = "ResourceARN"
            case tagKeys = "TagKeys"
        }
    }

    public struct UntagResourceResult: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateContactChannelRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact channel you want to update.
        public let contactChannelId: String
        /// The details that Incident Manager uses when trying to engage the contact channel.
        public let deliveryAddress: ContactChannelAddress?
        /// The name of the contact channel.
        public let name: String?

        @inlinable
        public init(contactChannelId: String, deliveryAddress: ContactChannelAddress? = nil, name: String? = nil) {
            self.contactChannelId = contactChannelId
            self.deliveryAddress = deliveryAddress
            self.name = name
        }

        public func validate(name: String) throws {
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, max: 2048)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, min: 1)
            try self.validate(self.contactChannelId, name: "contactChannelId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.deliveryAddress?.validate(name: "\(name).deliveryAddress")
            try self.validate(self.name, name: "name", parent: name, max: 255)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.\\-]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactChannelId = "ContactChannelId"
            case deliveryAddress = "DeliveryAddress"
            case name = "Name"
        }
    }

    public struct UpdateContactChannelResult: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateContactRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) of the contact or escalation plan you're updating.
        public let contactId: String
        /// The full name of the contact or escalation plan.
        public let displayName: String?
        /// A list of stages. A contact has an engagement plan with stages for specified contact channels. An escalation plan uses these stages to contact specified contacts.
        public let plan: Plan?

        @inlinable
        public init(contactId: String, displayName: String? = nil, plan: Plan? = nil) {
            self.contactId = contactId
            self.displayName = displayName
            self.plan = plan
        }

        public func validate(name: String) throws {
            try self.validate(self.contactId, name: "contactId", parent: name, max: 2048)
            try self.validate(self.contactId, name: "contactId", parent: name, min: 1)
            try self.validate(self.contactId, name: "contactId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.displayName, name: "displayName", parent: name, max: 255)
            try self.validate(self.displayName, name: "displayName", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.\\-]*$")
            try self.plan?.validate(name: "\(name).plan")
        }

        private enum CodingKeys: String, CodingKey {
            case contactId = "ContactId"
            case displayName = "DisplayName"
            case plan = "Plan"
        }
    }

    public struct UpdateContactResult: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateRotationRequest: AWSEncodableShape {
        /// The Amazon Resource Names (ARNs) of the contacts to include in the updated rotation.   Only the PERSONAL contact type is supported. The contact types ESCALATION and ONCALL_SCHEDULE are not supported for this operation.   The order in which you list the contacts is their shift order in the rotation schedule.
        public let contactIds: [String]?
        /// Information about how long the updated rotation lasts before restarting at the beginning of the shift order.
        public let recurrence: RecurrenceSettings
        /// The Amazon Resource Name (ARN) of the rotation to update.
        public let rotationId: String
        /// The date and time the rotation goes into effect.
        public let startTime: Date?
        /// The time zone to base the updated rotation’s activity on, in Internet Assigned Numbers Authority (IANA) format. For example: "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the Time Zone Database on the IANA website.  Designators for time zones that don’t support Daylight Savings Time Rules, such as Pacific Standard Time (PST), aren't supported.
        public let timeZoneId: String?

        @inlinable
        public init(contactIds: [String]? = nil, recurrence: RecurrenceSettings, rotationId: String, startTime: Date? = nil, timeZoneId: String? = nil) {
            self.contactIds = contactIds
            self.recurrence = recurrence
            self.rotationId = rotationId
            self.startTime = startTime
            self.timeZoneId = timeZoneId
        }

        public func validate(name: String) throws {
            try self.contactIds?.forEach {
                try validate($0, name: "contactIds[]", parent: name, max: 2048)
                try validate($0, name: "contactIds[]", parent: name, min: 1)
                try validate($0, name: "contactIds[]", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            }
            try self.validate(self.contactIds, name: "contactIds", parent: name, max: 30)
            try self.validate(self.contactIds, name: "contactIds", parent: name, min: 1)
            try self.recurrence.validate(name: "\(name).recurrence")
            try self.validate(self.rotationId, name: "rotationId", parent: name, max: 2048)
            try self.validate(self.rotationId, name: "rotationId", parent: name, min: 1)
            try self.validate(self.rotationId, name: "rotationId", parent: name, pattern: "^arn:(aws|aws-cn|aws-us-gov):ssm-contacts:[-\\w+=\\/,.@]*:[0-9]+:([\\w+=\\/,.@:-]+)*$")
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, max: 255)
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, min: 1)
            try self.validate(self.timeZoneId, name: "timeZoneId", parent: name, pattern: "^[:a-zA-Z0-9_\\-\\s\\.\\\\/]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case contactIds = "ContactIds"
            case recurrence = "Recurrence"
            case rotationId = "RotationId"
            case startTime = "StartTime"
            case timeZoneId = "TimeZoneId"
        }
    }

    public struct UpdateRotationResult: AWSDecodableShape {
        public init() {}
    }

    public struct ValidationException: AWSErrorShape {
        /// The fields that caused the error
        public let fields: [ValidationExceptionField]?
        public let message: String
        /// Reason the request failed validation
        public let reason: ValidationExceptionReason?

        @inlinable
        public init(fields: [ValidationExceptionField]? = nil, message: String, reason: ValidationExceptionReason? = nil) {
            self.fields = fields
            self.message = message
            self.reason = reason
        }

        private enum CodingKeys: String, CodingKey {
            case fields = "Fields"
            case message = "Message"
            case reason = "Reason"
        }
    }

    public struct ValidationExceptionField: AWSDecodableShape {
        /// Information about what caused the field to cause an exception.
        public let message: String
        /// The name of the field that caused the exception.
        public let name: String

        @inlinable
        public init(message: String, name: String) {
            self.message = message
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case message = "Message"
            case name = "Name"
        }
    }

    public struct WeeklySetting: AWSEncodableShape & AWSDecodableShape {
        /// The day of the week when weekly recurring on-call shift rotations begins.
        public let dayOfWeek: DayOfWeek
        /// The time of day when a weekly recurring on-call shift rotation begins.
        public let handOffTime: HandOffTime

        @inlinable
        public init(dayOfWeek: DayOfWeek, handOffTime: HandOffTime) {
            self.dayOfWeek = dayOfWeek
            self.handOffTime = handOffTime
        }

        public func validate(name: String) throws {
            try self.handOffTime.validate(name: "\(name).handOffTime")
        }

        private enum CodingKeys: String, CodingKey {
            case dayOfWeek = "DayOfWeek"
            case handOffTime = "HandOffTime"
        }
    }
}

// MARK: - Errors

/// Error enum for SSMContacts
public struct SSMContactsErrorType: AWSErrorType {
    enum Code: String {
        case accessDeniedException = "AccessDeniedException"
        case conflictException = "ConflictException"
        case dataEncryptionException = "DataEncryptionException"
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case throttlingException = "ThrottlingException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize SSMContacts
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// You don't have sufficient access to perform this operation.
    public static var accessDeniedException: Self { .init(.accessDeniedException) }
    /// Updating or deleting a resource causes an inconsistent state.
    public static var conflictException: Self { .init(.conflictException) }
    /// The operation failed to due an encryption key error.
    public static var dataEncryptionException: Self { .init(.dataEncryptionException) }
    /// Unexpected error occurred while processing the request.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// Request references a resource that doesn't exist.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// Request would cause a service quota to be exceeded.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// The request was denied due to request throttling.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// The input fails to satisfy the constraints specified by an Amazon Web Services service.
    public static var validationException: Self { .init(.validationException) }
}

extension SSMContactsErrorType: AWSServiceErrorType {
    public static let errorCodeMap: [String: AWSErrorShape.Type] = [
        "ConflictException": SSMContacts.ConflictException.self,
        "InternalServerException": SSMContacts.InternalServerException.self,
        "ResourceNotFoundException": SSMContacts.ResourceNotFoundException.self,
        "ServiceQuotaExceededException": SSMContacts.ServiceQuotaExceededException.self,
        "ThrottlingException": SSMContacts.ThrottlingException.self,
        "ValidationException": SSMContacts.ValidationException.self
    ]
}

extension SSMContactsErrorType: Equatable {
    public static func == (lhs: SSMContactsErrorType, rhs: SSMContactsErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension SSMContactsErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
